﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;
using System.Text;
namespace IHISCETeim.Web.MachineSys.YYModel
{
    public partial class YYShipmentAdd : PageBase
    {
        protected override string DWZRef
        {
            get
            {
                return "YYShipmentListEasyUI";
            }
        }

        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.新增 };
            }
        }


        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "add")
            {
                addmenu();
            }
        }
        private void addmenu()
        {

         //   YYShipmentInfo obj = Request.SerializableObject<YYShipmentInfo>();
            List<YYShipmentInfo> list = new List<YYShipmentInfo>();
           
            //char[] splitchar = new char[] { ',' };
            //string[] SerialNumbers = GetRequestValue<string>("SerialNumbers", "").Split(splitchar);

            //foreach (string SerialNumber in SerialNumbers)
            //{
            //    YYShipmentInfo objtmp = Request.SerializableObject<YYShipmentInfo>();
            //    objtmp.SerialNumber = SerialNumber;
            //    objtmp.Status = "未发";
            //    list.Add(objtmp);
            //}

            YYShipmentInfo obj = Request.SerializableObject<YYShipmentInfo>();
            obj.Status = "未发";
            list.Add(obj);

           // obj.Status = "未发";


            int id = YYShipmentController.Add(list);
            if (id > 0)
            {
                SuccessJson("成功添加出货进度");
            }
            else
            {

                ErrorJson("新增失败");
            }

        }
    }
}